#!/bin/bash

# This shell script runs funbot, but only if it isn't running already. You can
# use it in a crob job, to periodically relaunch the bot if it crashes. For
# example, to check every 10 minutes:
#
# # m   h  dom mon dow   command
#  */10 *   *   *   *    ~/funbot/util/run.sh
#
# (Use `crontab -e` to edit your cron table,
#  see `man 1 crontab` and `man 5 crontab`)

ps cax | grep funbot > /dev/null
if [ $? -ne 0 ]; then
    cd ~/funbot
    ./dist/build/funbot/funbot &
fi
